package cn.kgc.springcloud.service;

import cn.kgc.springcloud.entity.City;
import cn.kgc.springcloud.mapper.CityMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author: mosin
 * @version: v1.0  2022/6/15
 */
@Service
public class CityServiceImpl implements CityService {
    @Autowired
    private CityMapper cityMapper;

    @Override
    public List<City> selectAll() {
        List<City> cities = cityMapper.queryAll();
        return cities;
    }

    @Override
    public City addCity(City city) {
        Integer integer = cityMapper.saveCity(city);
        return city;
    }

    @Override
    public City getById(Integer id) {

        return cityMapper.getById(id);
    }
}
